<div class="row-fluid">
    <div class="span12">
        <div class="grid simple">
			<div class="grid-title no-border">
				<h4>Управление <span class="semi-bold">отзывами</span></h4>
			</div>				
			<div class="grid-body no-border email-body">
				<?php
				/* @var $this ReviewsController */
				/* @var $model Reviews */


				$this->breadcrumbs = array(
					'Reviews' => array('index'),
					'Управление',
				);
				?>
				<?php
				$form = $this->beginWidget('CActiveForm', array(
					'enableAjaxValidation' => true,
				));
				?>
				<?php
				$this->widget('bootstrap.widgets.TbGridView', array(
					'id' => 'reviews-grid',
					'dataProvider' => $model->search(),
					'filter' => $model,
					'htmlOptions'=>array(
						'class'=>'table-bordered table-hover',
					),
					'columns' => array(
						array(
							'id' => 'reviewId',
							'class' => 'CCheckBoxColumn',
							'selectableRows' => '50',
						),
						//'reviewId',
						'reviewContent:html',
						'reviewUsername',
						'reviewOrderNo',
						//'reviewUseremail',
						//'reviewUserphone',
						//'reviewDate',
						array(
							'name' => 'reviewDate',
							'header' => 'Дата',							
							'value' => 'date("d-m-Y", $data->reviewDate)'
						),
						array(
							'name' => 'reviewActive',
							'header' => 'Статус',
							'filter' => array('1' => 'Опубликован', '0' => 'Не опубликован'),
							'value' => '($data->reviewActive=="1")?("Опубликован"):("Не опубликован")'
						),
						array(
							'class' => 'bootstrap.widgets.TbButtonColumn',
						),
					),
				));
				?>
				<script>
					function reloadGrid(data) {
						$.fn.yiiGridView.update('reviews-grid');
					}
				</script>
				<div>
					<?php echo CHtml::ajaxSubmitButton('Опубликовать', array('reviews/ajaxupdate', 'act' => 'doActive'), array('success' => 'reloadGrid'), array('class' => 'btn btn-success btn-large', 'id' => 'button_left3')); ?>

					<?php echo CHtml::ajaxSubmitButton('Снять с публикации', array('reviews/ajaxupdate', 'act' => 'doInactive'), array('success' => 'reloadGrid'), array('class' => 'btn btn-danger btn-large', 'id' => 'button_left')); ?>
				</div>
				<?php $this->endWidget(); ?>
			</div>
        </div>	
    </div>
</div>